﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace 第二课堂评审系统.Models
{
    public class FinalConfig : IEntityTypeConfiguration<Final>
    {
        public void Configure(EntityTypeBuilder<Final> builder)
        {
            builder.ToTable("T_Final");
            builder.Property(f=>f.classRoom).HasMaxLength(20);
            builder.HasMany(p => p.Partnars).WithOne(p => p.final);
            builder.HasMany(p => p.judgesList).WithOne(p=>p.JudgeFin);
            builder.HasMany(p => p.Achievements).WithOne(p => p.final);
            builder.HasMany(p => p.JoinPartnars).WithOne(p => p.MyFinal);
        }
    }
}
